package com.wangsd.web.coupon.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * 签到配置表
 */
@Data
@Entity
@Table(name = "sign_config")
@ApiModel(value = "签到配置表", description = "签到配置表")
public class SignConfig {
    @ApiModelProperty(value = "id")
    /*mybatis plus 自增主键*/
    @TableId(type = IdType.AUTO)
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createdTime;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updatedTime;

    @ApiModelProperty(value = "（逻辑删除）是否已删；0，未删，1，已删")
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;

    @ApiModelProperty(value = "商圈id")
    private Long companyId;

    @ApiModelProperty(value = "签到默认积分")
    private Integer defaultPoint;

    @ApiModelProperty(value = "活动开始时间")
    @JsonFormat( pattern="yyyy-MM-dd HH:mm:ss")
    private Date beginTime;

    @ApiModelProperty(value = "活动结束时间")
    @JsonFormat( pattern="yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    @ApiModelProperty(value = "上下架状态 0,下架，1,上架")
    @Column(name = "status",columnDefinition = "int(11) default 0 not null")
    private Integer status;

    @ApiModelProperty(value = "活动结束时间")
    @Transient
    @TableField(exist = false)
    private String companyName;

    @ApiModelProperty(value = "配置明细list")
    @Transient
    @TableField(exist = false)
    private List<SignConfigDetail> signConfigDetailList;
}
